<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<title>瑞曼-论坛</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/style/skin.css" />
<script language="javascript" src="${pageContext.request.contextPath }/js/jquery-1.4.2.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/js/ForumUtils.js"></script>
<script type="text/javascript">
$().ready(function(){
    //设置分页要跳转到的url
	$("body").data("url","forumAction_showForumPageResult.action");
	//声明分页的事件
	ForumUtils.forum.initEvent();
});
    function deal(arg,n) {
        //var det = document.getElementsByClassName('detail')[n];
        if(arg == 'cha') {
			var det = document.getElementById('detail'+n)
            det.style.display = 'block';	//显示
        }
        if(arg == 'close') {
			var det = document.getElementById('detail'+n)
            det.style.display = 'none';		//隐藏
        }
        if(arg == 'del') {
            var s = window.confirm('您确定要删除吗？');	//确认对话框,返回true/false
			if(s == true)
			{
				//此时才真正去做删除工作。。。。。
				location.href = "forumAction_delete?forumid=" + n;	//这里就是传说中的使用get方式传数据到另一个页面
			}
        }
    }
    function logout() {
        window.confirm('您确定要退出吗?');
        window.location.href = 'forwardAction_login.action';
    }
</script>

<style type="text/css">

</style>
</head>
    <body>
        <div id="body">
            <h3>RainMan-论坛 后台管理</h3>
            <div id="nav">
                <ul>
                    <li><a href="forwardAction_shouyemanage.action">管理首页</a></li>
                    <li><a href="forumAction_showPageResult.action">前台首页</a></li>
                    <li><a href="javascript:void();" onclick="logout();">退出管理</a></li>
                </ul>
            </div>
            <div id="cont" style="padding-bottom:0px;">
                <div class="mes">
                    <span id="del"><a href="#">!删除全部</a></span>
					<!-- 留言区域开始 -->
					<s:if test="#request.forumVOlist">
                	<s:iterator value="%{#request.forumVOlist}" var="forumVO" status="st">
                    <div class="contr">
                        <div class="list">
                            <ul>
	                            <li>序号：<s:property value="#st.index + 1"/></li>
	                            <li>时间：<s:property value="%{#forumVO.publishtime}"/></li>
	                            <li>姓名：<s:property value="%{#forumVO.username}"/></li>
	                            <li>标题：<s:property value="%{#forumVO.title}"/></li>
                            </ul>
                        </div>
                        <ul>
                            <li><a href="javascript:void(0)" onclick="deal('cha',<s:property value="#st.index"/>);">查看内容</a></li>
                            <li><a href="forumliuyanAction_addUI.action?forumid=<s:property value='%{#forumVO.forumid}'/>">回复</a></li>
                            <li><a href="forumAction_updateUI.action?forumid=<s:property value='%{#forumVO.forumid}'/>">修改</a></li>
                            <li><a href="javascript:void(0)" onclick="deal('del',<s:property value='%{#forumVO.forumid}'/>);">删除</a></li>
                        </ul>
                        <div class="detail" id="detail<s:property value="#st.index"/>">
                            <span onclick="deal('close',<s:property value="#st.index"/>);">X关闭</span>
                            <p><s:property value="%{#forumVO.publishcontent}"/></p>
                        </div>
                    </div>
                    </s:iterator>
                	</s:if>
					<!-- 留言区域止 -->
                </div>
                <div id="page">
                    <span><a id="firstPage" param="1" flag="firstPage">首页</a></span>
                    <ul>
                        <li><a id="prepPage" flag="prePage" param="${PageResult.currentPage-1}">上一页</a></li>              
                        <li><a id="nextPage" param="${PageResult.currentPage+1}" flag="nextPage" last="${PageResult.totalPages}">下一页</a></li>
                        <li><a id="lastPage" param="${PageResult.totalPages}" flag="lastPage">尾页</a></li>
                        <li>总共有${PageResult.totalRows}条记录</li>
                        <li>当前是第${PageResult.currentPage}/${PageResult.totalPages}页</li>
                    </ul>
                </div>
            </div>
            <div id="foot">
                <p>RainMan-论坛 e-mail:zyc521008@sina.com</p>
                <p>Powered by 瑞曼论坛 V1.0 瑞曼科技 www.rain-man.cn</p>
            </div>
        </div>
    </body>
</html>